package priv.mill.client;

import priv.mill.net.MyDecoder;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.LengthFieldBasedFrameDecoder;

public class NetUtils {

	public static void addDe(SocketChannel ch) {
		
		LengthFieldBasedFrameDecoder lenthde = 
				new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE,0,4,0,4,true);
		ch.pipeline().addLast(lenthde);
		ch.pipeline().addLast(new MyDecoder());
		ch.pipeline().addLast(new MyEncoder());
//		ch.pipeline().addLast(new StringDecoder());
//		ch.pipeline().addLast(new StringEncoder());
	}

}
